#include <bits/stdc++.h>
// 2025/02/23
// tag:
// Author: Forever
using namespace std;

using int64 = int64_t;

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n, cnt = 0;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        int a, b, c;
        cin >> a >> b >> c;
        cnt += (a + b + c) >> 1;
    }
    cout << cnt << endl;
    return 0;
}